Optimal. Leaf size=221 \[ \frac{\left (2 i c^2-6 c d-7 i d^2\right ) \tanh ^{-1}\left (\frac{\sqrt{c+d \tan (e+f x)}}{\sqrt{c+i d}}\right )}{8 a^2 f (c+i d)^{5/2}}+\frac{(-5 d+2 i c) \sqrt{c+d \tan (e+f x)}}{8 a^2 f (c+i d)^2 (1+i \tan (e+f x))}-\frac{i \tanh ^{-1}\left (\frac{\sqrt{c+d \tan (e+f x)}}{\sqrt{c-i d}}\right )}{4 a^2 f \sqrt{c-i d}}-\frac{\sqrt{c+d \tan (e+f x)}}{4 f (-d+i c) (a+i a \tan (e+f x))^2} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.606299, antiderivative size = 221, normalized size of antiderivative = 1., number of steps used = 9, number of rules used = 6, integrand size = 30, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.2, Rules used = {3559, 3596, 3539, 3537, 63, 208} \[ \frac{\left (2 i c^2-6 c d-7 i d^2\right ) \tanh ^{-1}\left (\frac{\sqrt{c+d \tan (e+f x)}}{\sqrt{c+i d}}\right )}{8 a^2 f (c+i d)^{5/2}}+\frac{(-5 d+2 i c) \sqrt{c+d \tan (e+f x)}}{8 a^2 f (c+i d)^2 (1+i \tan (e+f x))}-\frac{i \tanh ^{-1}\left (\frac{\sqrt{c+d \tan (e+f x)}}{\sqrt{c-i d}}\right )}{4 a^2 f \sqrt{c-i d}}-\frac{\sqrt{c+d \tan (e+f x)}}{4 f (-d+i c) (a+i a \tan (e+f x))^2} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3559
Rule 3596
Rule 3539
Rule 3537
Rule 63
Rule 208
Rubi steps
\begin{align*} \int \frac{1}{(a+i a \tan (e+f x))^2 \sqrt{c+d \tan (e+f x)}} \, dx &=-\frac{\sqrt{c+d \tan (e+f x)}}{4 (i c-d) f (a+i a \tan (e+f x))^2}-\frac{\int \frac{-\frac{1}{2} a (4 i c-7 d)-\frac{3}{2} i a d \tan (e+f x)}{(a+i a \tan (e+f x)) \sqrt{c+d \tan (e+f x)}} \, dx}{4 a^2 (i c-d)}\\ &=\frac{(2 i c-5 d) \sqrt{c+d \tan (e+f x)}}{8 a^2 (c+i d)^2 f (1+i \tan (e+f x))}-\frac{\sqrt{c+d \tan (e+f x)}}{4 (i c-d) f (a+i a \tan (e+f x))^2}-\frac{\int \frac{-\frac{1}{2} a^2 \left (4 c^2+10 i c d-9 d^2\right )-\frac{1}{2} a^2 (2 c+5 i d) d \tan (e+f x)}{\sqrt{c+d \tan (e+f x)}} \, dx}{8 a^4 (c+i d)^2}\\ &=\frac{(2 i c-5 d) \sqrt{c+d \tan (e+f x)}}{8 a^2 (c+i d)^2 f (1+i \tan (e+f x))}-\frac{\sqrt{c+d \tan (e+f x)}}{4 (i c-d) f (a+i a \tan (e+f x))^2}+\frac{\int \frac{1+i \tan (e+f x)}{\sqrt{c+d \tan (e+f x)}} \, dx}{8 a^2}+\frac{\left (2 c^2+6 i c d-7 d^2\right ) \int \frac{1-i \tan (e+f x)}{\sqrt{c+d \tan (e+f x)}} \, dx}{16 a^2 (c+i d)^2}\\ &=\frac{(2 i c-5 d) \sqrt{c+d \tan (e+f x)}}{8 a^2 (c+i d)^2 f (1+i \tan (e+f x))}-\frac{\sqrt{c+d \tan (e+f x)}}{4 (i c-d) f (a+i a \tan (e+f x))^2}+\frac{i \operatorname{Subst}\left (\int \frac{1}{(-1+x) \sqrt{c-i d x}} \, dx,x,i \tan (e+f x)\right )}{8 a^2 f}-\frac{\left (i \left (2 c^2+6 i c d-7 d^2\right )\right ) \operatorname{Subst}\left (\int \frac{1}{(-1+x) \sqrt{c+i d x}} \, dx,x,-i \tan (e+f x)\right )}{16 a^2 (c+i d)^2 f}\\ &=\frac{(2 i c-5 d) \sqrt{c+d \tan (e+f x)}}{8 a^2 (c+i d)^2 f (1+i \tan (e+f x))}-\frac{\sqrt{c+d \tan (e+f x)}}{4 (i c-d) f (a+i a \tan (e+f x))^2}-\frac{\operatorname{Subst}\left (\int \frac{1}{-1-\frac{i c}{d}+\frac{i x^2}{d}} \, dx,x,\sqrt{c+d \tan (e+f x)}\right )}{4 a^2 d f}-\frac{\left (2 c^2+6 i c d-7 d^2\right ) \operatorname{Subst}\left (\int \frac{1}{-1+\frac{i c}{d}-\frac{i x^2}{d}} \, dx,x,\sqrt{c+d \tan (e+f x)}\right )}{8 a^2 (c+i d)^2 d f}\\ &=-\frac{i \tanh ^{-1}\left (\frac{\sqrt{c+d \tan (e+f x)}}{\sqrt{c-i d}}\right )}{4 a^2 \sqrt{c-i d} f}-\frac{\left (6 c d-i \left (2 c^2-7 d^2\right )\right ) \tanh ^{-1}\left (\frac{\sqrt{c+d \tan (e+f x)}}{\sqrt{c+i d}}\right )}{8 a^2 (c+i d)^{5/2} f}+\frac{(2 i c-5 d) \sqrt{c+d \tan (e+f x)}}{8 a^2 (c+i d)^2 f (1+i \tan (e+f x))}-\frac{\sqrt{c+d \tan (e+f x)}}{4 (i c-d) f (a+i a \tan (e+f x))^2}\\ \end{align*}
Mathematica [A] time = 1.97604, size = 275, normalized size = 1.24 \[ \frac{\sec ^2(e+f x) (\cos (f x)+i \sin (f x))^2 \left (\frac{2 (\cos (2 e)+i \sin (2 e)) \left (\sqrt{-c+i d} \left (-2 i c^2+6 c d+7 i d^2\right ) \tan ^{-1}\left (\frac{\sqrt{c+d \tan (e+f x)}}{\sqrt{-c-i d}}\right )+2 i (-c-i d)^{5/2} \tan ^{-1}\left (\frac{\sqrt{c+d \tan (e+f x)}}{\sqrt{-c+i d}}\right )\right )}{(-c-i d)^{5/2} \sqrt{-c+i d}}+\frac{2 \cos (e+f x) (\sin (2 f x)+i \cos (2 f x)) \sqrt{c+d \tan (e+f x)} ((-5 d+2 i c) \sin (e+f x)+(4 c+7 i d) \cos (e+f x))}{(c+i d)^2}\right )}{16 f (a+i a \tan (e+f x))^2} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] time = 0.08, size = 502, normalized size = 2.3 \begin{align*}{\frac{{\frac{i}{4}}}{f{a}^{2}}\arctan \left ({\sqrt{c+d\tan \left ( fx+e \right ) }{\frac{1}{\sqrt{id-c}}}} \right ){\frac{1}{\sqrt{id-c}}}}+{\frac{{\frac{5\,i}{8}}{d}^{2}}{f{a}^{2} \left ( -id+d\tan \left ( fx+e \right ) \right ) ^{2} \left ( -{d}^{2}+2\,icd+{c}^{2} \right ) } \left ( c+d\tan \left ( fx+e \right ) \right ) ^{{\frac{3}{2}}}}+{\frac{cd}{4\,f{a}^{2} \left ( -id+d\tan \left ( fx+e \right ) \right ) ^{2} \left ( -{d}^{2}+2\,icd+{c}^{2} \right ) } \left ( c+d\tan \left ( fx+e \right ) \right ) ^{{\frac{3}{2}}}}-{\frac{{\frac{9\,i}{8}}{d}^{2}c}{f{a}^{2} \left ( -id+d\tan \left ( fx+e \right ) \right ) ^{2} \left ( -{d}^{2}+2\,icd+{c}^{2} \right ) }\sqrt{c+d\tan \left ( fx+e \right ) }}-{\frac{{c}^{2}d}{4\,f{a}^{2} \left ( -id+d\tan \left ( fx+e \right ) \right ) ^{2} \left ( -{d}^{2}+2\,icd+{c}^{2} \right ) }\sqrt{c+d\tan \left ( fx+e \right ) }}+{\frac{7\,{d}^{3}}{8\,f{a}^{2} \left ( -id+d\tan \left ( fx+e \right ) \right ) ^{2} \left ( -{d}^{2}+2\,icd+{c}^{2} \right ) }\sqrt{c+d\tan \left ( fx+e \right ) }}-{\frac{{\frac{i}{4}}{c}^{2}}{f{a}^{2} \left ( -{d}^{2}+2\,icd+{c}^{2} \right ) }\arctan \left ({\sqrt{c+d\tan \left ( fx+e \right ) }{\frac{1}{\sqrt{-id-c}}}} \right ){\frac{1}{\sqrt{-id-c}}}}+{\frac{{\frac{7\,i}{8}}{d}^{2}}{f{a}^{2} \left ( -{d}^{2}+2\,icd+{c}^{2} \right ) }\arctan \left ({\sqrt{c+d\tan \left ( fx+e \right ) }{\frac{1}{\sqrt{-id-c}}}} \right ){\frac{1}{\sqrt{-id-c}}}}+{\frac{3\,cd}{4\,f{a}^{2} \left ( -{d}^{2}+2\,icd+{c}^{2} \right ) }\arctan \left ({\sqrt{c+d\tan \left ( fx+e \right ) }{\frac{1}{\sqrt{-id-c}}}} \right ){\frac{1}{\sqrt{-id-c}}}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: RuntimeError} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] time = 3.5673, size = 3421, normalized size = 15.48 \begin{align*} \text{result too large to display} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-2)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: AttributeError} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] time = 1.59023, size = 680, normalized size = 3.08 \begin{align*} \frac{1}{4} \, d^{3}{\left (\frac{16 \,{\left (2 \, c^{2} + 6 i \, c d - 7 \, d^{2}\right )} \arctan \left (\frac{4 \,{\left (\sqrt{d \tan \left (f x + e\right ) + c} c - \sqrt{c^{2} + d^{2}} \sqrt{d \tan \left (f x + e\right ) + c}\right )}}{c \sqrt{-8 \, c + 8 \, \sqrt{c^{2} + d^{2}}} + i \, \sqrt{-8 \, c + 8 \, \sqrt{c^{2} + d^{2}}} d - \sqrt{c^{2} + d^{2}} \sqrt{-8 \, c + 8 \, \sqrt{c^{2} + d^{2}}}}\right )}{{\left (8 i \, a^{2} c^{2} d^{3} f - 16 \, a^{2} c d^{4} f - 8 i \, a^{2} d^{5} f\right )} \sqrt{-8 \, c + 8 \, \sqrt{c^{2} + d^{2}}}{\left (\frac{i \, d}{c - \sqrt{c^{2} + d^{2}}} + 1\right )}} + \frac{8 \,{\left (2 \,{\left (d \tan \left (f x + e\right ) + c\right )}^{\frac{3}{2}} c - 2 \, \sqrt{d \tan \left (f x + e\right ) + c} c^{2} + 5 i \,{\left (d \tan \left (f x + e\right ) + c\right )}^{\frac{3}{2}} d - 9 i \, \sqrt{d \tan \left (f x + e\right ) + c} c d + 7 \, \sqrt{d \tan \left (f x + e\right ) + c} d^{2}\right )}}{{\left (16 \, a^{2} c^{2} d^{2} f + 32 i \, a^{2} c d^{3} f - 16 \, a^{2} d^{4} f\right )}{\left (d \tan \left (f x + e\right ) - i \, d\right )}^{2}} - \frac{\sqrt{2} \arctan \left (\frac{16 i \, \sqrt{d \tan \left (f x + e\right ) + c} c + 16 i \, \sqrt{c^{2} + d^{2}} \sqrt{d \tan \left (f x + e\right ) + c}}{8 \, \sqrt{2} \sqrt{c + \sqrt{c^{2} + d^{2}}} c - 8 i \, \sqrt{2} \sqrt{c + \sqrt{c^{2} + d^{2}}} d + 8 \, \sqrt{2} \sqrt{c^{2} + d^{2}} \sqrt{c + \sqrt{c^{2} + d^{2}}}}\right )}{a^{2} \sqrt{c + \sqrt{c^{2} + d^{2}}} d^{3} f{\left (-\frac{i \, d}{c + \sqrt{c^{2} + d^{2}}} + 1\right )}}\right )} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]